<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>点击穿透</title>
    <script src="http://47.104.209.44/base/js/jquery-1.10.1.min.js"></script>
    <style>
        .mask {
            width: 100%;
            height: 100vh;
            background: rgba(0, 0, 0, 0.4);
            position: absolute;
            left: 0;
            top: 0;
            color: #fff;
            font-size: 30px;
            padding: 20px;
            box-sizing: border-box;
        }

        .box {
            color: red;
            font-size: 30px;
            padding: 20px;
            box-sizing: border-box;
            width: 80%;
            height: 300px;
            margin: 180px auto;
            background: orangered;
            border-radius: 10px;
        }
    </style>
</head>

<body>
    <a class="box" href="https://www.baidu.com/">
        点击我进入 百度主页
    </a>
    <div class="mask">我是一个遮罩层，点击我关闭</div>
</body>
<script>
    // 混用 click 和 touch 就会导致点击穿透
    $(".mask").on("touchstart", function () {
        $(this).hide()
    })

    // $(".box").on("click", function () {
    //     $(this).css("background", "blue")
    // })
</script>

</html>